草庐IT

java.lang.OutOfMemoryError : PermGen space 错误

全部标签

ruby-on-rails - Puma 和 Nginx 502 Bad Gateway 错误(Ubuntu 服务器 14.04)

我需要部署我的Rails应用程序,所以我从这里开始执行了所有步骤,https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04但是在教程结束时,我得到了这个错误-->“502BadGateway”编辑现在的错误消息-->“很抱歉,出了点问题。”但是Nginx错误输出是相同的,我检查了puma错误消息,但它们只是记录它何时启动以及何时正常停止。位于app_directory/log下的Rails日志不产生任何输出。puma-man

ruby-on-rails - 路由错误页面 404

当用户尝试访问不存在的路由时,我有一个异常ActionController::RoutingError。如何将用户重定向到404.html页面或在该页面上呈现错误?例如:当我尝试访问https://github.com/someuser时我在该URL上收到404页面。我在应用程序Controller中试过这个但没有成功:rescue_fromActionController::RoutingErrordo|exception|render'/public/404.html'end 最佳答案 这是一个known问题。你应该看看那里发表

ruby - 为什么带有无效参数的范围有时不会导致参数错误?

以下代码会导致参数错误:n=15(n%4==0)..(n%3==0)#=>badvalueforrange(ArgumentError)我认为这是因为它评估为:false..true并且范围内使用了不同类型的类:TrueClass和FalseClass。但是,以下代码不会引发错误。这是为什么?Enumerable#collect能捕捉到它吗?(11..20).collect{|i|(i%4==0)..(i%3==0)?i:nil}#=>noerror稍后添加:如果fcn返回15,则只评估范围的前半部分deffcn(x)putsx15endif(fcn(1)%4==0)..(fcn(2)

ruby - 在 Mac OSX 10.6.8 上安装 ruby​​ 1.9.3 时安装日志中出现 Openssl 错误消息

您好,我正在尝试使用以下代码通过rvm安装ruby​​:CC=/usr/bin/gcc-4.2rvminstall1.9.3--with-iconv-dir=$rvm_path/usr--with-openssh-dir=$rvm_path/usr但我在(安装)make.log文件中遇到错误:Infileincludedfromopenssl_missing.c:22:450openssl_missing.h:71:error:conflictingtypesfor‘HMAC_CTX_copy’451/Users/Sebastian/.rvm/usr/include/openssl/h

ruby - 类型错误 : no implicit conversion of Hash into String

尝试解析一些JSON,为什么text是空的?期望的输出:text应该返回Helloworld\n\nApple,Harbor\n\nBanana,Kitchen\n\nMango,Bedroomtext="Helloworld"json='{"fruits":[{"name":"Apple","location":"Harbor"},{"name":"Banana","location":"Kitchen"},{"name":"Mango","location":"Bedroom"}]}'fruits=JSON.parse(json)defformat_fruits(fruits)fr

ruby - 使用 ruby​​ mechanize 捕获超时错误

我有一个Mechanize功能可以让我退出网站,但在极少数情况下它会让我超时。该功能涉及转到特定页面,然后单击注销按钮。有时,当进入注销页面或单击注销按钮时,mechanize会遇到超时,代码会崩溃。所以我做了一个小的救援,它似乎在第一段代码下面看到的那样工作。deflogmeout(agent)page=agent.get('http://www.example.com/')agent.click(page.link_with(:text=>/LogOut/i))end通过救援注销:deflogmeout(agent)beginpage=agent.get('http://www.e

ruby - RMagick - ImageMagick 给出错误 "no decode delegate for this image format"

当我尝试操作从sinatra上传的图像时出现问题。File.open(params[:file][:tempfile])do|p|thumb=Magick::Image.read(p)thumb.crop_resized!(75,75,Magick::NorthGravity)end上传的文件是jpeg,上传图片时的表单数据包括{:filename=>"299732_176749115737355_100002068035867_380115_618512842_n.jpg",:type=>"image/jpeg",:name=>"file",:tempfile=>#,:head=>"

ruby - 尝试使用 Selenium Webdriver v3.70 最大化浏览器窗口时出现 Ruby "KeyError: key not found: 102"错误

我最近将我的SeleniumWebdriver版本升级到3.70,当我尝试最大化浏览器窗口时,出现此错误:KeyError:keynotfound:102预先最大化窗口(在以前的版本中)似乎工作得非常好,我不确定这是否只是巧合,因为它不是标准类型的Selenium错误。这是我的代码:profile=Selenium::WebDriver::Chrome::Profile.new$driver=Selenium::WebDriver.for:chrome,:profile=>profile$driver.manage.window.maximize还有其他人遇到这个问题吗?另外值得注意的

ruby-on-rails - 路由错误 : Uninitialized constant in Rails 3

我有一个包含类似这样的辅助类的文件:应用程序/类/myfile.rbModulemymoduleclassmyclass#blahblahendend我想在Controller中使用这个类,所以我写了这样的东西:require'myfile'classMyControllerController的路由定义如下:match'mycontroller',:to=>'mycontroller#index'现在是我面临的奇怪行为。它在服务器启动后的第一次运行中工作得很好。但是,当我刷新页面或再次点击URL时,出现以下错误。RoutingErroruninitializedconstantMyC

ruby-on-rails - Heroku ruby​​ buildpack 错误 - 未定义的局部变量或方法 `install_language_pack_gems'

我刚刚将我的Rails3.2.16应用程序的ruby​​版本从1.9.2升级到2.0.0,并且在本地一切正常。但是,当尝试推送到Heroku时,编译失败。它检测ruby​​版本,开始安装依赖项,然后崩溃:----->CompilingRuby/Rails----->UsingRubyversion:ruby-2.0.0----->Installingdependenciesusing1.5.2Rubyversionchangedetected.Clearingbundlercache.Old:ruby1.9.3p484(2013-11-22revision43786)[x86_64-l